$().ready(function() {
    $( document ).tooltip();
    validateRule();
    var viewer = new Viewer(document.getElementById('showlicenseImg'));
});

$.validator.setDefaults({
    submitHandler : function() {
        audit();
    }
});
var g_status = 1;
function changeDiv(status){
    if(status == 1){
        g_status=1;
        $("#refuseReason").val('');
        $('#reasonDiv').hide();
    }else{
        g_status=2;
        $('#reasonDiv').show();
    }
}
function audit() {
    if(g_status == 2){
        if($("#refuseReason").val() == ''){
            parent.layer.alert("请填写拒绝理由");
            return;
        }
    }
    $.ajax({
        cache : true,
        type : "POST",
        url : "/shop/shenhe",
        data : $('#signupForm').serialize(),// 你的formid
        async : false,
        error : function(request) {
            parent.layer.alert("服务器异常，请联系管理员");
        },
        success : function(data) {
            if (data.code == 0) {
                parent.layer.msg("操作成功");
                parent.reLoad();
                var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
                parent.layer.close(index);
            } else {
                parent.layer.alert(data.msg)
            }
        }
    });

}

function showBig(){
    var licenseUrl = $("#licenseUrl").val();
    $("#showlicenseImg").attr("src",licenseUrl);
    $("#showlicenseImg").click();
    //parent.showBig(licenseUrl);
}
function validateRule() {
    var icon = "<i class='fa fa-times-circle'></i> ";
    $("#signupForm").validate({
        rules : {

        },
        messages : {

        }
    })
}



